﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProcessManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.ProcessManagement.ProcessResultsVMs
{
    public partial class ProcessResultsTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ProcessResults._Rotue")]
        public ExcelPropety Rotue_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.RotueId);
        [Display(Name = "_Model._ProcessResults._Op")]
        public ExcelPropety Op_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.OpId);
        [Display(Name = "_Model._ProcessResults._OpCode")]
        public ExcelPropety OpCode_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.OpCode);
        [Display(Name = "_Model._ProcessResults._TagId")]
        public ExcelPropety TagId_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.TagId);
        [Display(Name = "_Model._ProcessResults._TagName")]
        public ExcelPropety TagName_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.TagName);
        [Display(Name = "_Model._ProcessResults._DataName")]
        public ExcelPropety DataName_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.DataName);
        [Display(Name = "_Model._ProcessResults._Unit")]
        public ExcelPropety Unit_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.Unit);
        [Display(Name = "_Model._ProcessResults._UpperLimit")]
        public ExcelPropety UpperLimit_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.UpperLimit);
        [Display(Name = "_Model._ProcessResults._LowerLimit")]
        public ExcelPropety LowerLimit_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.LowerLimit);
        [Display(Name = "_Model._ProcessResults._ActiveLimit")]
        public ExcelPropety ActiveLimit_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.ActiveLimit);
        [Display(Name = "_Model._ProcessResults._ProductId")]
        public ExcelPropety ProductId_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.ProductId);
        [Display(Name = "_Model._ProcessResults._EquipmentId")]
        public ExcelPropety EquipmentId_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.EquipmentId);
        [Display(Name = "_Model._ProcessResults._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.CreateTime, true);
        [Display(Name = "_Model._ProcessResults._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ProcessResults._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.CreateBy);
        [Display(Name = "_Model._ProcessResults._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.UpdateBy);
        [Display(Name = "_Model._ProcessResults._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.IsValid);
        [Display(Name = "_Model._ProcessResults._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ProcessResults>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Rotue_Excel.DataType = ColumnDataType.ComboBox;
            Rotue_Excel.ListItems = DC.Set<ProcessRoute>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());
            Op_Excel.DataType = ColumnDataType.ComboBox;
            Op_Excel.ListItems = DC.Set<ProcessRouteItem>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProcessResultsImportVM : BaseImportVM<ProcessResultsTemplateVM, ProcessResults>
    {
            //import

    }

}